/**
 * @Author ouxueting
 */
package com.chinaunicom.tour.sys.service;

import com.chinaunicom.tour.sys.entity.User;
import com.chinaunicom.tour.sys.entity.UserFollow;
import com.chinaunicom.tour.sys.mapper.UserFollowMapper;
import com.chinaunicom.tour.sys.model.UserFollowModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserFollowService {

    @Autowired
    UserFollowMapper userFollowMapper;

   public  int add(UserFollow entity){
       entity.setCreateTime(new Date());
       return userFollowMapper.add(entity);
   }

   public int delete(UserFollow entity){

       return userFollowMapper.delete(entity);
   }

   public UserFollow findByUserIdAndFollowUserId(UserFollowModel queryModel){
       return userFollowMapper.findByUserIdAndFollowUserId(queryModel);
   }
    public int followPageQueryCount(UserFollowModel queryModel) {

       return userFollowMapper.followPageQueryCount(queryModel);
    }
    public List<User> followPageQuery(UserFollowModel queryModel) {
        return userFollowMapper.followPageQuery(queryModel);
    }
    public int followedPageQueryCount(UserFollowModel queryModel) {

        return userFollowMapper.followedPageQueryCount(queryModel);
    }
    public List<User> followedPageQuery(UserFollowModel queryModel) {
        return userFollowMapper.followedPageQuery(queryModel);
    }
}
